package com.hrt.datasender.web.strategy;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.btcode.web.core.annotation.RequestMapping;
import com.btcode.web.core.controller.Controller;
import com.hrt.common.web.DSRequestUnit;

/**
 * 策略
 * 
 * @author gislin
 *
 */
@RequestMapping(path = "Strategy")
public class StrategyController extends Controller {

    @RequestMapping(path = "getList")
    public void getModel(ServletRequest arg0, ServletResponse arg1)
            throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {

        List<StrategyModel> strategys = StrategyService.getInstance().getExistMonitorDataStrategy();

        success(strategys);
    }

    @RequestMapping(path = "getListByPlatform")
    public void getListByPlatform(ServletRequest arg0, ServletResponse arg1)
            throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {

        String platformId = DSRequestUnit.getString("platformId");

        List<StrategyModel> strategys = StrategyService.getInstance().getListByPlatform(platformId);

        success(strategys);
    }

}
